﻿<h1><?php echo $model->username; ?></h1>
<?php 

// For all users
	$attributes = array(
			'username',
	);
	
	$profileFields=ProfileField::model()->forAll()->sort()->findAll();
	if ($profileFields) {
		foreach($profileFields as $field) {
			array_push($attributes,array(
					'label' => UserModule::t($field->title),
					'name' => $field->varname,
					'value' => (($field->widgetView($model->profile))?$field->widgetView($model->profile):(($field->range)?Profile::range($field->range,$model->profile->getAttribute($field->varname)):$model->profile->getAttribute($field->varname))),

				));
		}
	}
	array_push($attributes,
		'create_at',
		array(
			'name' => 'lastvisit_at',
			'value' => (($model->lastvisit_at!='0000-00-00 00:00:00')?$model->lastvisit_at:UserModule::t('Not visited')),
		)
	);
?>	
	<table>
	<tr>
		<td>
		<?php
		$this->widget('zii.widgets.CDetailView', array(
			'data'=>$model,
			'attributes'=>$attributes,
		));
		?>
		</td>
		<td>
		<img src="/files/default_profile.jpg" alt="UserImage" height="150" width="150">
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<td>
		<?php echo CHtml::link("Saját oldalam", array("/creatives/Private&id=".Yii::app()->user->id.""));?>
	</td>
	<tr>
		<td><b>Pontok:</b></td>
	
	</tr>
	<tr>
		<td>
			<?php $this->widget('zii.widgets.CListView', array(
				'dataProvider'=>$user_points,
				'itemView'=>'_view',
				'summaryText' => '',
			)); ?>
		</td>
		<td></td>
	</tr>
	<tr>
	<td>
			<b>Érvényes ajánlataim:</b>		
			
			<?php $this->widget('zii.widgets.CListView', array(
				'dataProvider'=>$SwapsAll,
				'itemView'=>'_view_swap',
				'summaryText' => '',
			)); ?>

	</td>
	<td>
			<b>csereberéim:</b>
	
			<?php $this->widget('zii.widgets.CListView', array(
			'dataProvider'=>$OwnSwaps,
			'itemView'=>'_view_swap',
			'summaryText' => '',
		)); ?>
	</td>
	</tr>
	
	</table>
